<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basproject/basicdata/Bas_Material.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basproject/basicdata/Bas_Material.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Bas_Material",
        setup() {
            const table = ref({
                key: "MaterialId",
                footer: "Foots",
                cnName: "物品管理",
                name: "basicdata/Bas_Material",
                newTabEdit: false,
                url: "/Bas_Material/",
                sortName: "MaterialId"
            });
            const editFormFields = ref({"MaterialCategory":"","MaterialCode":"","MaterialName":"","Variant":"","MaterialSpec":"","MaterialType":"","UnitName":"","ValidDays":"","EnableDoubleUnit":"","ModelId":"","SafetyQty":"","WarningQty":"","IqcFlag":"","IsCe":"","Enabled":""});
            const editFormOptions = ref([[{"dataKey":"MatCategor","data":[],"title":"物料分类","required":true,"field":"MaterialCategory","type":"select"},
                               {"title":"物料编号","field":"MaterialCode"},
                               {"title":"物料名称","field":"MaterialName"}],
                              [{"title":"物料类型","field":"MaterialType"},
                               {"title":"物料规格","field":"MaterialSpec"},
                               {"title":"变体值","field":"Variant"}],
                              [{"title":"单位","field":"UnitName"},
                               {"title":"库存有效天数","field":"ValidDays","type":"number"},
                               {"dataKey":"enabled","data":[],"title":"是否开启第二单位","field":"EnableDoubleUnit","type":"switch"}],
                              [{"title":"安全库存","field":"SafetyQty","type":"decimal"},
                               {"title":"预警库存","field":"WarningQty","type":"decimal"},
                               {"dataKey":"BASE_ModelList","data":[],"title":"机种ID","field":"ModelId","type":"select"}],
                              [{"dataKey":"enabled","data":[],"title":"是否启用","field":"Enabled","type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"是否IQC检验","field":"IqcFlag","type":"switch"},
                               {"dataKey":"enabled","data":[],"title":"是否含ce","field":"IsCe","type":"switch"}]]);
            const searchFormFields = ref({"MaterialCode":"","MaterialName":"","MaterialSpec":""});
            const searchFormOptions = ref([[{"title":"物料名称","field":"MaterialName","type":"like"},{"title":"物料规格","field":"MaterialSpec","type":"like"}],[{"title":"物料编号","field":"MaterialCode","type":"like"}]]);
            const columns = ref([{field:"MaterialCategory",title:"物料分类",type:"int",bind:{ key:"MatCategor",data:[]},width:120,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialCode",title:"物料编号",type:"string",link:true,width:120,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialName",title:"物料名称",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Variant",title:"变体值",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialSpec",title:"物料规格",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialType",title:"物料类型",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ModelId",title:"机种ID",type:"bigint",bind:{ key:"BASE_ModelList",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"UnitName",title:"单位",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"SafetyQty",title:"安全库存",type:"decimal",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"WarningQty",title:"预警库存",type:"decimal",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ValidDays",title:"库存有效天数",type:"int",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"EnableDoubleUnit",title:"是否开启第二单位",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"DoubleUnitRatio",title:"第二单位转化率",type:"decimal",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"DoubleUnitName",title:"第二单位",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"IqcFlag",title:"是否IQC检验",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"IsCe",title:"是否含ce",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"MaterialId",title:"ID",type:"bigint",width:120,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:120,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"Property1",title:"Property1",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"TobId",title:"TobId",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Tracking",title:"AMes字段tracking  追溯： lot：批次，serial:序列号，none：不追溯",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"QualityControlPointQty",title:"是否需要质检",type:"int",width:120,hidden:true,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
